-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: fix the issue of missing sentinel password in store redis mode #5930
Conversation
import redis.clients.jedis.JedisPoolAbstract; | ||
import redis.clients.jedis.JedisPoolConfig; | ||
import redis.clients.jedis.JedisSentinelPool; | ||
import redis.clients.jedis.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要使用*引入
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -98,7 +94,8 @@ public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisP | |||
Set<String> sentinels = new HashSet<>(SENTINEL_HOST_NUMBER); | |||
String[] sentinelHosts = CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_HOST).split(","); | |||
Arrays.asList(sentinelHosts).forEach(sentinelHost -> sentinels.add(sentinelHost)); | |||
tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE)); | |||
tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE), | |||
null, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_PASSWORD), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这后面的null是什么参数?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clientName、sentinelClientName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
script/config-center/config.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不止这里,server的yml里的配置要补充,以及starter模块里对应的properties也要补充
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #5930 +/- ##
============================================
+ Coverage 49.50% 49.51% +0.01%
- Complexity 4510 4515 +5
============================================
Files 854 854
Lines 29876 29880 +4
Branches 3660 3660
============================================
+ Hits 14789 14795 +6
+ Misses 13601 13595 -6
- Partials 1486 1490 +4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
当store.redis.mode=sentinel时,设置哨兵密码时,代码中缺少哨兵密码
Ⅱ. Does this pull request fix one issue?
Fixes #4161
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews